#include "choose.h"
#include "FactorTable.h"
#include "LargeSampleSimulationUI.h"
#include <QToolBar>
#include <iostream>
#include <fstream>
#include <string>
#include <direct.h>
#include <io.h>
#include <sys/types.h>
#include "anova.h"
#include <algorithm>
#include <unordered_map>


choose::choose(QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	connect(ui.ImportButton, SIGNAL(clicked()), this, SLOT(ImportTable()));
	connect(ui.InputButton, SIGNAL(clicked()), this, SLOT(InputFactorTable()));

}

choose::~choose()
{
}

void choose::ImportTable()
{
	this->close();
	emit ImportButtonClicked();

}

void choose::InputFactorTable()
{
	NewInputFactor = new InputFactor;
	connect(NewInputFactor, SIGNAL(ShowInputTable(QStringList, std::vector<std::vector<float>>)), this, SLOT(ShowInputSlot(QStringList, std::vector<std::vector<float>>)));
	NewInputFactor->show();
	this->close();
}

void choose::ShowInputSlot(QStringList factorNames, std::vector<std::vector<float>> FactorLevelData)
{
	emit ShowFactorSignal(factorNames, FactorLevelData);
}



